// pages/agent/users.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list:[],
    pageIndex:1,
    loadding: false,
  },

  onLoad(options) {
    this.load();
  },
  async load(){
    let res=await wx.util.post("agent/userlist",{page:this.data.pageIndex},this.data.pageIndex>1);
    this.setData({
      pageIndex:this.data.pageIndex++,
      list:this.data.list.concat(res.data.data),
      loadding:false
    })
  },
  onReachBottom() {
    this.setData({
      loadding:true
    })
    this.load();
  }
})